import {getdetail} from '../request/api'
Page({

  /**
   * 页面的初始数据
   */
  data: {
      arr:[
      ]
  },

 demo(e){
      let id= e.currentTarget.dataset.id
      wx.navigateTo({
        url:'../../pages/detail/detail?id='+id,
      })
  },

    async getHomeDetail(){
      let res =await getdetail()
      this.setData ({
          arr:res.data.list.slice(0,4)
      })
    }, 
    
  onLoad: function (options) {
      this.getHomeDetail()
  },
 })